<?php
/**
 * Description of EditarAlumno
 *
 * @author Mariano
 */
class EditarAlumnoForm extends AlumnoForm
{
    public function configure()
  {
       $this->disableLocalCSRFProtection();

          $this->widgetSchema['nombre_usuario'] = new sfWidgetFormInputHidden(array('default'=>$this->getObject()->getNombreUsuario()), array());
          $this->widgetSchema->setLabel('nombre_usuario', false);

          $this->widgetSchema['legajo_alumno'] = new sfWidgetFormInputHidden(array('default'=>$this->getObject()->getLegajoAlumno()),array());
          $this->widgetSchema->setLabel('legajo_alumno', false);


          $this->widgetSchema['anio'] = new sfWidgetFormInputHidden(array('default'=>$this->getObject()->getAnio()),array());
          $this->widgetSchema->setLabel('anio', false);

           $this->validatorSchema['password']->setOption('required',true);
           $this->validatorSchema['password']->setMessage('required', 'Este campo es obligatorio');


           $this->validatorSchema['nombre']->setOption('required',true);
           $this->validatorSchema['nombre']->setMessage('required', 'Este campo es obligatorio');

           $this->validatorSchema['apellido']->setOption('required',true);
           $this->validatorSchema['apellido']->setMessage('required', 'Este campo es obligatorio');

          $this->validatorSchema->setPostValidator(
          new sfValidatorAnd(array(
            new sfValidatorDoctrineUnique(array('model' => 'Preceptor', 'column' => array('nombre_usuario'))),
            new sfValidatorDoctrineUnique(array('model' => 'Preceptor', 'column' => array('email'))), )));





  }

    
    public function  __construct($object = null, $options = array(), $CSRFSecret = null) {
        parent::__construct($object, $options, $CSRFSecret);
    }
}
?>
